package model

import (
	"gorm.io/gorm"
	"onerk4/zk2/common/global"
)

type CourseReservation struct {
	gorm.Model
	UserId    int    `gorm:"type:int(11);not null;comment:用户Id"`
	CourseId  int    `gorm:"type:int(11);not null;comment:课程Id"`
	Course    string `gorm:"type:varchar(50);not null;comment:课程"`
	Date      string `gorm:"type:varchar(50);not null;comment:日期"`
	Time      string `gorm:"type:varchar(50);not null;comment:时间"`
	Stadium   string `gorm:"type:varchar(50);not null;comment:场馆"`
	Site      string `gorm:"type:varchar(50);not null;comment:场地"`
	PeopleNum int    `gorm:"type:int(11);not null;comment:人数"`
	Coach     string `gorm:"type:varchar(50);not null;comment:教练"`
	Memo      string `gorm:"type:text;not null;comment:备注信息"`
	Status    int    `gorm:"type:int(11);not null;comment:状态 1-待上课 2-等位中 3-已完成 4-已取消"`
}

func (r *CourseReservation) ReservationCourse() error {
	return global.DB.Create(&r).Error
}
